package com.sh.studytwo;

import android.os.Bundle;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.Button;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class ButtonLongActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_button_long);
        Button btn_long = findViewById(R.id.activity_button_long);
        TextView btnRes = findViewById(R.id.tv_result_long);
        btn_long.setOnLongClickListener(V -> {
            btnRes.setText("长按的结果");
            return true;
        });

    }
}